<template>
  <div class="not-found-container">
    <!-- 极光背景 -->
    <div class="aurora-background"></div>
    
    <div class="content">
      <!-- 404 图标和文字 -->
      <div class="error-section">
        <div class="error-icon">
          <SearchX :size="120" class="text-blue-purple-400" />
        </div>
        <h1 class="error-code">404</h1>
        <h2 class="error-title">页面未找到</h2>
        <p class="error-description">
          抱歉，您访问的页面不存在或已被移动。
        </p>
      </div>

      <!-- 操作按钮 -->
      <div class="actions">
        <Button 
          type="primary" 
          size="large" 
          class="btn-home"
          @click="goHome"
        >
          <Home :size="16" class="mr-2" />
          返回首页
        </Button>
        <Button 
          size="large" 
          class="btn-back ml-4"
          @click="goBack"
        >
          <ArrowLeft :size="16" class="mr-2" />
          返回上页
        </Button>
      </div>

      <!-- 建议链接 -->
      <div class="suggestions">
        <p class="suggestions-title">您可能想要访问：</p>
        <div class="suggestions-links">
          <router-link to="/" class="suggestion-link">
            <Home :size="16" />
            <span>首页</span>
          </router-link>
          <router-link to="/role" class="suggestion-link">
            <Users :size="16" />
            <span>角色管理</span>
          </router-link>
          <router-link to="/knowledge-base" class="suggestion-link">
            <BookOpen :size="16" />
            <span>知识库</span>
          </router-link>
          <router-link to="/multi-chat" class="suggestion-link">
            <MessageSquare :size="16" />
            <span>多人聊天</span>
          </router-link>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { Button } from 'ant-design-vue'
import { SearchX, Home, ArrowLeft, Users, BookOpen, MessageSquare } from 'lucide-vue-next'
import { useRouter } from 'vue-router'

const router = useRouter()

const goHome = () => {
  router.push('/')
}

const goBack = () => {
  if (window.history.length > 1) {
    router.go(-1)
  } else {
    router.push('/')
  }
}
</script>

<style scoped>
.not-found-container {
  min-height: max(100vh, 1200px);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  
}

.aurora-background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-size: 400% 400%;
  animation: aurora 60s linear infinite;
}

@keyframes aurora {
  0% { background-position: 50% 50%; }
  25% { background-position: 100% 0%; }
  50% { background-position: 150% 50%; }
  75% { background-position: 100% 100%; }
  100% { background-position: 50% 50%; }
}

.content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 600px;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.error-section {
  margin-bottom: 3rem;
}

.error-icon {
  margin-bottom: 1.5rem;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

.error-code {
  font-size: 6rem;
  font-weight: 800;
  margin: 0;
  background: linear-gradient(135deg, #60a5fa, #6366f1, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.error-title {
  font-size: 2rem;
  font-weight: 600;
  margin: 1rem 0;
  color: #374151;
}

.error-description {
  font-size: 1.1rem;
  color: #6b7280;
  margin: 0;
  line-height: 1.6;
}

.actions {
  margin-bottom: 3rem;
}

.btn-home {
  background: linear-gradient(135deg, #60a5fa, #3b82f6);
  border: none;
  height: 48px;
  padding: 0 2rem;
  border-radius: 12px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-home:hover {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

.btn-back {
  height: 48px;
  padding: 0 2rem;
  border-radius: 12px;
  font-weight: 500;
  border: 2px solid #e5e7eb;
  transition: all 0.3s ease;
}

.btn-back:hover {
  border-color: #60a5fa;
  color: #60a5fa;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(96, 165, 250, 0.2);
}

.suggestions {
  text-align: left;
}

.suggestions-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 1rem;
  text-align: center;
}

.suggestions-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.suggestion-link {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  background: rgba(96, 165, 250, 0.1);
  border: 1px solid rgba(96, 165, 250, 0.2);
  border-radius: 12px;
  color: #374151;
  text-decoration: none;
  transition: all 0.3s ease;
  font-weight: 500;
}

.suggestion-link:hover {
  background: rgba(96, 165, 250, 0.2);
  border-color: #60a5fa;
  color: #60a5fa;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(96, 165, 250, 0.2);
}

.suggestion-link svg {
  margin-right: 0.5rem;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .content {
    margin: 1rem;
    padding: 1.5rem;
  }
  
  .error-code {
    font-size: 4rem;
  }
  
  .error-title {
    font-size: 1.5rem;
  }
  
  .actions {
    flex-direction: column;
    gap: 1rem;
  }
  
  .btn-back {
    margin-left: 0 !important;
  }
  
  .suggestions-links {
    grid-template-columns: 1fr;
  }
}
</style>